#ifndef _OM_PREREQUISITE_H_
#define _OM_PREREQUISITE_H_

#define MSVC
#define OM_MULTI_THREAD_SUPPORT

#ifdef MSVC
#pragma warning (disable : 4996)
#pragma warning (disable : 4251)
#endif

#pragma warning (disable:4275)

#ifndef UNICODE
#define UNICODE
#endif
#ifdef UNICODE
#define OM_UNICODE
#endif

#include <windows.h>

#define OM_ADDIN_PROJECT
#ifdef OM_ADDIN_PROJECT
	#define OmExport
#else
	#ifdef OM_EXPORTDLL
		#define OmExport __declspec( dllexport )
	#else
		#define OmExport __declspec( dllimport )
	#endif
#endif

//----------------------------------
#define OM_AUTO_MUTEX_NAME mutex
#ifdef OM_MULTI_THREAD_SUPPORT
//#define OM_AUTO_MUTEX mutable boost::recursive_mutex OM_AUTO_MUTEX_NAME;
//#define OM_LOCK_AUTO_MUTEX boost::recursive_mutex::scoped_lock omAutoMutexLock(OM_AUTO_MUTEX_NAME);
#define OM_AUTO_MUTEX mutable AutoMutex OM_AUTO_MUTEX_NAME;
#define OM_LOCK_AUTO_MUTEX AutoMutexLock autoMutexLock(OM_AUTO_MUTEX_NAME);
#define OM_LOCK_USERNAMED_AUTO_MUTEX(mutexName) AutoMutexLock autoMutexLock(mutexName);
#else
#define OM_AUTO_MUTEX
#define OM_LOCK_AUTO_MUTEX
#endif

//----------------------------------
#define OM_SAFE_DELETE(var) \
	delete var;\
	var = 0;

#define OM_DELETE delete
#define OM_NEW new

namespace OmPublic
{
	class Log;
	class LogListener;
	class LogManager;
	class Exception;
	class Mutex;
	class AutoMutex;
	class AutoMutexLock;
	class FixedLength;
}

#include "OmStdHeader.h"
using std::vector;
using std::map;
using std::wstring;
using std::string;
using std::deque;

#include "OmBase.h"
using OmPublic::LimitedLengthQueue;

#define COUNT(n) sizeof(n)/ sizeof(n[0])

#endif